package com.springboot.service.impl;

import com.springboot.bean.Emp;
import com.springboot.bean.ResultCode;
import com.springboot.mapper.EmpMapper;
import com.springboot.service.EmpService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EmpServiceImpl implements EmpService {
    @Resource
    private EmpMapper empMapper;
    @Override
    public ResultCode<List<Emp>> findAllEmp() {
        try {
            return new ResultCode<List<Emp>>("200","null",empMapper.findAllEmp());
        } catch (Exception e) {
            return new ResultCode<List<Emp>>("500",e.getMessage(),null);
        }
    }
}
